﻿#include "windows.h"

HINSTANCE hFuncInst;
typedef struct _MARGINS
{
        int cxLeftWidth;
        int cxRightWidth;
        int cyTopHeight;
        int cyBottomHeight;
}
MARGINS, *PMARGINS;
typedef BOOL (WINAPI *MYFUNC)(HWND, MARGINS*);

int main()
{

        hFuncInst = LoadLibrary(L"dwmapi.DLL");
        MYFUNC DwmExtendFrameIntoClientArea;
        MARGINS mar = { -1};
        DwmExtendFrameIntoClientArea = (MYFUNC)GetProcAddress(hFuncInst, "DwmExtendFrameIntoClientArea");
        HWND hwnd = FindWindow(0, L"C:\\Windows\\system32\\cmd.exe");
        if (hwnd != NULL) DwmExtendFrameIntoClientArea(hwnd, &mar);

		LONG ExtendedStyle = GetWindowLong( hwnd,
			GWL_EXSTYLE );

		SetWindowLong( hwnd,
			GWL_EXSTYLE,
			ExtendedStyle | WS_EX_LAYERED );
		SetLayeredWindowAttributes(hwnd, 0, 100, LWA_ALPHA);
}